set :deploy_to, "/home/crap4j/#{application}_production"

# note, this could be updated to play nicely with the new namespaces,
# but instead, we used a :before hook in ../deploy.rb

task :after_update, :roles => :app do
    run "cp /home/#{user}/benchmark_server_settings/database.yml #{release_path}/config/database.yml"
    run "cp /home/#{user}/benchmark_server_settings/environment.rb #{release_path}/config/environment.rb"
end


set :static_site, "/home/crap4j/crap4j.org"
task :make_static_site, :roles => :app do
  # take these two lines out of the run. We don't want to blow away the wordpress news dir
  # until we get it building from version control as well.
  # rm -rf #{static_site} &&
  # mkdir -p #{static_site} &&
  #
  # also leave out linking news to itself
  # ln -nfs /home/crap4j/crap4j.org/news #{static_site}/news
  run <<-CMD
    svn export --force http://svn.crap4j.org/crap4j/crap4jsite #{static_site}/ &&
    ln -nfs #{deploy_to}/current #{static_site}/#{application} &&
    ln -nfs #{static_site}/#{application}/charts #{static_site}/charts
  CMD
end
